﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Wicresoft.Common;
using JDEduTrain.Framework.Entity;
using JDEduTrain.Framework.Business;

public partial class Page_CreditDetail : BaseAuthenticationPage
{
    public Guid CreditID
    {
        get
        {
            if (Request["CreditID"] != null)
                return new Guid(Request["CreditID"]);
            return Guid.Empty;
        }
    }

    public bool IsAudit
    {
        get
        {
            if (Request["IsAudit"] != null)
                return bool.Parse(Request["IsAudit"]);
            return false;
        }
    }


    protected void Page_Load(object sender, EventArgs e)
    {
        this.UseTabber = true;
        if (!IsPostBack)
        {
            BindCredit();
            if (IsAudit)
            {
                tblOperator.Visible = false;
            }
        }
    }

    protected void BindCredit()
    {
        TrainCredit trainCredit = new TrainCredit(CreditID);
        if (trainCredit.Load())
        {
            tbBeginTime.Text = trainCredit.BeginTime.ToShortDateString();
            tbCreditName.Text = trainCredit.CreditName;
            tbComment.Text =  HttpUtility.HtmlDecode(trainCredit.Comment);
            tbEndTime.Text = trainCredit.EndTime.ToShortDateString();
            tbScore.Text = trainCredit.Score.ToString();
            tbMainContent.Text = trainCredit.MainContent;
            tbTrainLevel.Text = trainCredit.TrainLevel;
            tbTrainDay.Text = trainCredit.TrainDayCount.ToString();
            tbHostUnit.Text = trainCredit.HostUnit;
            if (trainCredit.Status == "终审通过")
            {
                trToolMenu.Visible = false;
            }

        }

    }
    protected void btnRefresh_Click(object sender, EventArgs e)
    {
        BindCredit();
    }

}
